package service

import (
	"context"
	"github.com/aphasia51/website/internal/domain"
	"github.com/aphasia51/website/internal/repository"
)

type ExperimentService struct {
	repo *repository.ExperimentRepository
}

func NewExperimentService(repo *repository.ExperimentRepository) *ExperimentService {
	return &ExperimentService{
		repo: repo,
	}
}

func (svc *ExperimentService) Query(ctx context.Context, a domain.Experiment) ([]domain.Experiment, error) {
	return svc.repo.Query(ctx, a)
}

func (svc *ExperimentService) Create(ctx context.Context, a domain.Experiment) (int64, error) {
	return svc.repo.Create(ctx, a)
}

func (svc *ExperimentService) Delete(ctx context.Context, ids []string) (int64, error) {
	return svc.repo.Delete(ctx, ids)
}

func (svc *ExperimentService) QueryModuleTest(ctx context.Context, ModuleId string) ([]domain.Question, error) {
	return svc.repo.QueryModuleTest(ctx, ModuleId)
}

func (svc *ExperimentService) QueryRelatedModule(ctx context.Context, a domain.Experiment) ([]domain.CommonItem, error) {
	return svc.repo.QueryRelatedModule(ctx, a)
}

func (svc *ExperimentService) QueryNeedToLearnModule(ctx context.Context, a domain.Experiment) ([]domain.CommonItem, error) {
	return svc.repo.QueryNeedToLearnModule(ctx, a)
}
